<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::TiltShakeRecognizer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html">TiltShakeRecognizer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="class_sifteo_1_1_tilt_shake_recognizer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::TiltShakeRecognizer Class Reference<div class="ingroups"><a class="el" href="group__motion.html">Motion</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>A standard recognizer for shake and tilt gestures.  
 <a href="class_sifteo_1_1_tilt_shake_recognizer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="motion_8h_source.html">sifteo/motion.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a01fb99fdb0c94ff50953a0c9c2a75eb4"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4">ChangeFlags</a> { <br/>
&#160;&#160;<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a84dc84f307ac2347279ed05a6f7b3c19">Shake_Begin</a> = 1 &lt;&lt; 0, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4af7409a54c99a9bf56bf6b2d9f851f267">Shake_End</a> = 1 &lt;&lt; 1, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a9f72907f11222345f22c0f8f307c7026">Shake_Change</a> = Shake_Begin | Shake_End, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4ad2f5f9c41b2311a15f028703c8bcf96d">Tilt_XNeg</a> = 1 &lt;&lt; 2, 
<br/>
&#160;&#160;<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a52460006adaf9ebc056b38d7ac6cf6c9">Tilt_XZero</a> = 1 &lt;&lt; 3, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a318fdba520473de4b40819b31fbe3d59">Tilt_XPos</a> = 1 &lt;&lt; 4, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a357fdb093087cefd541a36798eb7f92d">Tilt_XChange</a> = Tilt_XNeg | Tilt_XZero | Tilt_XPos, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4afebfe1b3ab31de3ea99a65c41cef70be">Tilt_YNeg</a> = 1 &lt;&lt; 5, 
<br/>
&#160;&#160;<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a509a4fe888c8f527793c23cf61b0adf1">Tilt_YZero</a> = 1 &lt;&lt; 6, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a8d2794d03ef4a39f4613248b4215d118">Tilt_YPos</a> = 1 &lt;&lt; 7, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a8572aefc6188f492076e3cb6cdfa42c7">Tilt_YChange</a> = Tilt_YNeg | Tilt_YZero | Tilt_YPos, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a899a41cff5edee30b557fbf48761b612">Tilt_ZNeg</a> = 1 &lt;&lt; 8, 
<br/>
&#160;&#160;<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a3434e37068202a4a1e56a501d2c1cab4">Tilt_ZZero</a> = 1 &lt;&lt; 9, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a378dba6d283360200927dc69d7265d60">Tilt_ZPos</a> = 1 &lt;&lt; 10, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a8ce9ce5df240dd8be54e236984a75bf9">Tilt_ZChange</a> = Tilt_ZNeg | Tilt_ZZero | Tilt_ZPos, 
<a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4a38a244e39aaf1cc75c608609fd7298cc">Tilt_Change</a> = Tilt_XChange | Tilt_YChange | Tilt_ZChange
<br/>
 }</td></tr>
<tr class="memdesc:a01fb99fdb0c94ff50953a0c9c2a75eb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change flags, returned by <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#adb652e01d5b155997bb916224f363992" title="Update the state of the TiltShakeRecognizer.">update()</a> to indicate what just changed.  <a href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4">More...</a><br/></td></tr>
<tr class="separator:a01fb99fdb0c94ff50953a0c9c2a75eb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac59854881fcc9c51f35f079c47768aeb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#ac59854881fcc9c51f35f079c47768aeb">attach</a> (_SYSCubeID id)</td></tr>
<tr class="memdesc:ac59854881fcc9c51f35f079c47768aeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize this <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a> and attach it to a cube.  <a href="#ac59854881fcc9c51f35f079c47768aeb">More...</a><br/></td></tr>
<tr class="separator:ac59854881fcc9c51f35f079c47768aeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21d92e421d68a74044593c8e8972633c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__math.html#gaec7afb90b5c1db8751abaf5f0406f6b7">Byte3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a21d92e421d68a74044593c8e8972633c">physicalTilt</a> () const </td></tr>
<tr class="memdesc:a21d92e421d68a74044593c8e8972633c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the physical tilt reading for the attached cube.  <a href="#a21d92e421d68a74044593c8e8972633c">More...</a><br/></td></tr>
<tr class="separator:a21d92e421d68a74044593c8e8972633c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb652e01d5b155997bb916224f363992"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#adb652e01d5b155997bb916224f363992">update</a> (int latency=kFilterLatency)</td></tr>
<tr class="memdesc:adb652e01d5b155997bb916224f363992"><td class="mdescLeft">&#160;</td><td class="mdescRight">Update the state of the <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a>.  <a href="#adb652e01d5b155997bb916224f363992">More...</a><br/></td></tr>
<tr class="separator:adb652e01d5b155997bb916224f363992"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5b131a4d445867fef50a0e69ce330a3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__math.html#gaec7afb90b5c1db8751abaf5f0406f6b7">Byte3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#af5b131a4d445867fef50a0e69ce330a3">virtualTilt</a> (<a class="el" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3">Side</a> orientation) const </td></tr>
<tr class="memdesc:af5b131a4d445867fef50a0e69ce330a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the virtual tilt reading for the attached cube.  <a href="#af5b131a4d445867fef50a0e69ce330a3">More...</a><br/></td></tr>
<tr class="separator:af5b131a4d445867fef50a0e69ce330a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:afa4e1bba1ec375856002761e96737c84"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_sifteo_1_1_motion_buffer.html">MotionBuffer</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#afa4e1bba1ec375856002761e96737c84">buffer</a></td></tr>
<tr class="memdesc:afa4e1bba1ec375856002761e96737c84"><td class="mdescLeft">&#160;</td><td class="mdescRight">The <a class="el" href="struct_sifteo_1_1_motion_buffer.html" title="A memory buffer which holds captured motion data.">MotionBuffer</a> used by this <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a>.  <a href="#afa4e1bba1ec375856002761e96737c84">More...</a><br/></td></tr>
<tr class="separator:afa4e1bba1ec375856002761e96737c84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b3953f692a7a68dd4b26600172de7e3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_sifteo_1_1_motion_median.html">MotionMedian</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a1b3953f692a7a68dd4b26600172de7e3">median</a></td></tr>
<tr class="memdesc:a1b3953f692a7a68dd4b26600172de7e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">The most recent median data calculated by the <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a>.  <a href="#a1b3953f692a7a68dd4b26600172de7e3">More...</a><br/></td></tr>
<tr class="separator:a1b3953f692a7a68dd4b26600172de7e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0f44403a7a8552e9f8e81a8b34b07c2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac0f44403a7a8552e9f8e81a8b34b07c2"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#ac0f44403a7a8552e9f8e81a8b34b07c2">shake</a></td></tr>
<tr class="memdesc:ac0f44403a7a8552e9f8e81a8b34b07c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">The most recent binary shake state. <br/></td></tr>
<tr class="separator:ac0f44403a7a8552e9f8e81a8b34b07c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c97f21b06aee37eb349fd788461ca58"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__math.html#gaec7afb90b5c1db8751abaf5f0406f6b7">Byte3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a4c97f21b06aee37eb349fd788461ca58">tilt</a></td></tr>
<tr class="memdesc:a4c97f21b06aee37eb349fd788461ca58"><td class="mdescLeft">&#160;</td><td class="mdescRight">The most recent tilt value.  <a href="#a4c97f21b06aee37eb349fd788461ca58">More...</a><br/></td></tr>
<tr class="separator:a4c97f21b06aee37eb349fd788461ca58"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A standard recognizer for shake and tilt gestures. </p>
<p>This class contains a <a class="el" href="struct_sifteo_1_1_motion_buffer.html" title="A memory buffer which holds captured motion data.">MotionBuffer</a> as well as other state which is necessary to detect the standard tilt and shake gestures. This filter can be updated as a result of an <a class="el" href="namespace_sifteo_1_1_events.html#a79e3f4a8813fef07c672925e1b15512d" title="A cube&#39;s accelerometer state has changed.">Events::cubeAccelChange</a> event, or once per frame, or even less often. We provide median statistics, as well as simple binary tilt and shake outputs with hysteresis. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#a01fb99fdb0c94ff50953a0c9c2a75eb4">Sifteo::TiltShakeRecognizer::ChangeFlags</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Change flags, returned by <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#adb652e01d5b155997bb916224f363992" title="Update the state of the TiltShakeRecognizer.">update()</a> to indicate what just changed. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a84dc84f307ac2347279ed05a6f7b3c19"></a>Shake_Begin</em>&nbsp;</td><td class="fielddoc">
<p>'shake' has changed to 'true' </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4af7409a54c99a9bf56bf6b2d9f851f267"></a>Shake_End</em>&nbsp;</td><td class="fielddoc">
<p>'shake' has changed to 'false' </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a9f72907f11222345f22c0f8f307c7026"></a>Shake_Change</em>&nbsp;</td><td class="fielddoc">
<p>'shake' has changed </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4ad2f5f9c41b2311a15f028703c8bcf96d"></a>Tilt_XNeg</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.x' has changed to -1 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a52460006adaf9ebc056b38d7ac6cf6c9"></a>Tilt_XZero</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.x' has changed to 0 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a318fdba520473de4b40819b31fbe3d59"></a>Tilt_XPos</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.x' has changed to +1 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a357fdb093087cefd541a36798eb7f92d"></a>Tilt_XChange</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.x' has changed </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4afebfe1b3ab31de3ea99a65c41cef70be"></a>Tilt_YNeg</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.y' has changed to -1 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a509a4fe888c8f527793c23cf61b0adf1"></a>Tilt_YZero</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.y' has changed to 0 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a8d2794d03ef4a39f4613248b4215d118"></a>Tilt_YPos</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.y' has changed to +1 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a8572aefc6188f492076e3cb6cdfa42c7"></a>Tilt_YChange</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.y' has changed </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a899a41cff5edee30b557fbf48761b612"></a>Tilt_ZNeg</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.z' has changed to -1 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a3434e37068202a4a1e56a501d2c1cab4"></a>Tilt_ZZero</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.z' has changed to 0 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a378dba6d283360200927dc69d7265d60"></a>Tilt_ZPos</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.z' has changed to +1 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a8ce9ce5df240dd8be54e236984a75bf9"></a>Tilt_ZChange</em>&nbsp;</td><td class="fielddoc">
<p>'tilt.z' has changed </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a01fb99fdb0c94ff50953a0c9c2a75eb4a38a244e39aaf1cc75c608609fd7298cc"></a>Tilt_Change</em>&nbsp;</td><td class="fielddoc">
<p>'tilt' has changed </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ac59854881fcc9c51f35f079c47768aeb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::TiltShakeRecognizer::attach </td>
          <td>(</td>
          <td class="paramtype">_SYSCubeID&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize this <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a> and attach it to a cube. </p>
<p>This invokes <a class="el" href="struct_sifteo_1_1_motion_buffer.html#ab750cdfb46707c12e07351ebe1a9ba6a" title="Initialize the MotionBuffer and attach it to a cube.">MotionBuffer::attach()</a>, and resets the state of the <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a> itself. </p>

</div>
</div>
<a class="anchor" id="a21d92e421d68a74044593c8e8972633c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__math.html#gaec7afb90b5c1db8751abaf5f0406f6b7">Byte3</a> Sifteo::TiltShakeRecognizer::physicalTilt </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the physical tilt reading for the attached cube. </p>
<p>The resulting vector is oriented with respect to the cube hardware. The underlying tilt state is only updated after an explicit call to <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#adb652e01d5b155997bb916224f363992" title="Update the state of the TiltShakeRecognizer.">update()</a>. </p>

</div>
</div>
<a class="anchor" id="adb652e01d5b155997bb916224f363992"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">unsigned Sifteo::TiltShakeRecognizer::update </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>latency</em> = <code>kFilterLatency</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Update the state of the <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a>. </p>
<p>Using data captured in our <a class="el" href="struct_sifteo_1_1_motion_buffer.html" title="A memory buffer which holds captured motion data.">MotionBuffer</a>, this updates the state of the <code>median</code> filter, and calculates a new tilt and shake state for the attached cube. After this call, the <code>tilt</code> and <code>shake</code> members will contain the latest state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">latency</td><td>(optional) Specifies the duration of the window on which the filter operates. The default is <a class="el" href="struct_sifteo_1_1_motion_buffer.html#a3c6c96116960f2d30e71db772c528ded" title="Reciprocal of the MotionBuffer&#39;s timestamp unit, in Hertz.">MotionBuffer&lt;&gt;::TICK_HZ</a> / 30, or 1/30th of a second.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a bitmap of ChangeFlags which describe which changes just occurred. </dd></dl>

</div>
</div>
<a class="anchor" id="af5b131a4d445867fef50a0e69ce330a3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__math.html#gaec7afb90b5c1db8751abaf5f0406f6b7">Byte3</a> Sifteo::TiltShakeRecognizer::virtualTilt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3">Side</a>&#160;</td>
          <td class="paramname"><em>orientation</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the virtual tilt reading for the attached cube. </p>
<p>The resulting vector is oriented with respect to the current LCD rotation. The underlying tilt state is only updated after an explicit call to <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#adb652e01d5b155997bb916224f363992" title="Update the state of the TiltShakeRecognizer.">update()</a>.</p>
<p>Requires the orientation of the attached cube, which can be obtained via <a class="el" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">VideoBuffer::orientation()</a>. </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="afa4e1bba1ec375856002761e96737c84"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_sifteo_1_1_motion_buffer.html">MotionBuffer</a> Sifteo::TiltShakeRecognizer::buffer</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The <a class="el" href="struct_sifteo_1_1_motion_buffer.html" title="A memory buffer which holds captured motion data.">MotionBuffer</a> used by this <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a>. </p>
<p>This is part of the <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a> class in order to make the common use case convenient, but it may also be used directly if your application must process raw motion data as well as these standard gestures. </p>

</div>
</div>
<a class="anchor" id="a1b3953f692a7a68dd4b26600172de7e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_sifteo_1_1_motion_median.html">MotionMedian</a> Sifteo::TiltShakeRecognizer::median</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The most recent median data calculated by the <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html" title="A standard recognizer for shake and tilt gestures.">TiltShakeRecognizer</a>. </p>
<p>This contains the results of the intermediate median, minimum, and maximum statistics as calculated during <a class="el" href="class_sifteo_1_1_tilt_shake_recognizer.html#adb652e01d5b155997bb916224f363992" title="Update the state of the TiltShakeRecognizer.">update()</a>. If your application needs to perform additional processing on the motion data, these results are available at no extra cost. </p>

</div>
</div>
<a class="anchor" id="a4c97f21b06aee37eb349fd788461ca58"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__math.html#gaec7afb90b5c1db8751abaf5f0406f6b7">Byte3</a> Sifteo::TiltShakeRecognizer::tilt</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The most recent tilt value. </p>
<p>Each axis is -1, 0, or +1. The coordinate system is identical to that used by <a class="el" href="struct_sifteo_1_1_cube_i_d.html#a6da5d2ed7096f343f921b2a879c54e80" title="Return the physical accelerometer state, as a signed byte-vector.">CubeID::accel()</a>. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="motion_8h_source.html">motion.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
